package com.itheima.springboot_24_mq.service.impl.rabbitmq.direct.listense;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//@Component //要能够被springboot加载
public class MessageListener2 { //监控同一个队列的2个监听器轮流执行插入队列任务
    @RabbitListener(queues = "directQueue") //指定消息队列的名称,可以是个数组,即监听多个队列
    public void receive(String id){
        System.out.println("lisentener从队列中达到了消息2:"+id);
    }
}
